<?php

declare(strict_types=1);

namespace App\AdminApi\Module\User\Api;

use App\AdminApi\AdminApiBasicsController;
use App\Common\Enums\SexEnums;
use App\AdminApi\Module\User\Service\{TagsService};
use App\AdminApi\Module\User\Service\LevelService;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\GetMapping;
use Psr\Http\Message\ResponseInterface;
use Zms\Guard\Auth;
use Zms\HyperfResponse\Response;

#[
    Controller(prefix: '/admin-api/filter-panel', server: self::SERVER),
    Auth(guard: self::GUARD, sign: 'skip', app: self::APP)
]
class FilterPanelController extends AdminApiBasicsController
{


    #[
        GetMapping('user-level'),
        Auth(label: ['会员等级'], logger: false)
    ]
    public function UserLevel(LevelService $service): ResponseInterface
    {
        return Response::Api()->success(data: $service->dictionary());
    }


    #[
        GetMapping('user-tags'),
        Auth(label: ['会员标签'], logger: false)
    ]
    public function UserTags(TagsService $service): ResponseInterface
    {
        return Response::Api()->success(data: $service->dictionary());
    }



    #[
        GetMapping('sex'),
        Auth(label: ['性别数据'], logger: false)
    ]
    public function sex(): ResponseInterface
    {
        return Response::Api()->success(data: SexEnums::Datas());
    }
}
